package com.atguigu.gulimall.search.vo;

import com.atguigu.common.to.es.SkuEsModel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

@Data
public class SearchResult implements Serializable {
    //查询到的所有商品信息
    private List<SkuEsModel> products;

    //当前页码、总记录数、总页码
    private Integer pageNum;
    private Long total;
    private Integer totalPages;
    private List<Integer> pageNavs;

    //结果类型所涉及的品牌(展示品牌信息)
    private List<BrandVo> brands;
    //分类(展示分类信息)
    private List<AttrVo> attrs;
    //所设计的属性(展示属性信息)
    private List<CatalogVo> catalogs;

    /**
     * 面包屑导航数据
     */
    private List<NavVo> navs = new ArrayList<>();
    private List<Long> attrIds = new ArrayList<>();

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    public static class NavVo {
        private String navName;
        private String navValue;
        private String link;
    }

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    public static class BrandVo {
        private Long brandId;
        private String brandName;
        private String brandImg;
    }

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    public static class AttrVo {
        private Long attrId;
        private String attrName;
        private List<String> attrValue;
    }


    @Data
    @NoArgsConstructor//为类提供一个无参的构造方法
    @AllArgsConstructor//添加一个构造函数，该构造函数含有所有已声明字段属性参数
    public static class CatalogVo {
        private Long catalogId;
        private String catalogName;
    }
}
